﻿using System;
using System.Collections.Generic;

namespace Bilibili.Model.Live
{
    public sealed class LiveVideoModel
    {
        public int code { get; set; }
        public string message { get; set; }
        public LiveVideoModel data { get; set; }
        public List<LiveVideoModel> items { get; set; }
        public string next_offset { get; set; }
        public LiveVideoModel user { get; set; }
        public string uid { get; set; }
        public string head_url { get; set; }
        public string name { get; set; }
        public int is_vip { get; set; }
        public LiveVideoModel item { get; set; }
        public LiveVideoModel cover { get; set; }
        public string _default { get; set; }
        public string share_url { get; set; }
        public int type { get; set; }
        public string description { get; set; }
        public List<string> tags { get; set; }
        public string Tag
        {
            get
            {
                if (tags != null && tags.Count != 0)
                    return "#" + tags[0] + "#";
                else
                    return "";
            }
        }
        public double video_time { get; set; }
        public string Time
        {
            get
            {
                if (type == 0)
                {
                    var ts = TimeSpan.FromSeconds(video_time);
                    return ts.Minutes + ":" + ts.Seconds;
                }
                else
                    return "";
            }
        }
        public string upload_time { get; set; }
        public string jump_url { get; set; }
        public string damaku_num { get; set; }
        public string watched_num { get; set; }
        public string video_playurl { get; set; }
        public bool Vis
        {
            get
            {
                return type == 0;
            }
        }
    }
}